package com.nustalk;

import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.Toast;

public class MainActivity extends TabActivity {
	EditText chatBox;
	ScrollView scroller;
	Button sendButton;
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Resources ressources = getResources(); 
		TabHost tabHost = getTabHost(); 
		
		// Android tab
		Intent intentAndroid = new Intent().setClass(this, TBuddiesActivity.class);
		TabSpec tabSpecAndroid = tabHost
			.newTabSpec("Android")
			.setIndicator("", ressources.getDrawable(R.drawable.icon_android_config))
			.setContent(intentAndroid);

		// Buddies tab
		Intent intentBuddies = new Intent().setClass(this, TBuddiesActivity.class);
		TabSpec tabSpecBuddies = tabHost
			.newTabSpec("Buddies")
			.setIndicator("", ressources.getDrawable(R.drawable.icon_apple_config))
			.setContent(intentBuddies);
		
		// Chat tab
		Intent intentChat = new Intent().setClass(this, TChatActivity.class);
		TabSpec tabSpecChat = tabHost
			.newTabSpec("Chat")
			.setIndicator("", ressources.getDrawable(R.drawable.icon_windows_config))
			.setContent(intentChat);
		
		// Group tab
		Intent intentGroup = new Intent().setClass(this, TGroupActivity.class);
		TabSpec tabSpecGroup = tabHost
			.newTabSpec("Group")
			.setIndicator("", ressources.getDrawable(R.drawable.icon_blackberry_config))
			.setContent(intentGroup);
	
		// add all tabs 
		tabHost.addTab(tabSpecBuddies);
		tabHost.addTab(tabSpecChat);
		tabHost.addTab(tabSpecGroup);
		
		//set Windows tab as default (zero based)
		tabHost.setCurrentTab(0);
	}

}